package com.yao.factory.factory;

import com.yao.factory.service.Color;
import com.yao.factory.service.Shape;
import com.yao.factory.service.impl.Blue;
import com.yao.factory.service.impl.Green;
import com.yao.factory.service.impl.Red;

public class ColorFactory extends AbstractFactory {
	
	@Override
	public Color getColor(String color) {
		if (color == null) {
			return null;
		}

		if (color.equalsIgnoreCase("Red")) {
			return new Red();
		} else if (color.equalsIgnoreCase("Green")) {
			return new Green();
		} else if (color.equalsIgnoreCase("Blue")) {
			return new Blue();
		}

		return null;
	}

	@Override
	public Shape getShape(String shape) {
		return null;
	}

}
